const fs = require('fs')
const path = require('path')

fs.readFile(path.join(__dirname, './12312/2.html'),(err,data)=>{
  console.log(data.toString())
  const str = data.toString()
  const strHtml = str.replace(/\r\n/g,'')
  fs.readFile(path.join(__dirname, './12312/3.js') , (err2, data2) => {
    console.log(data2.toString())
    const str2 = data2.toString()
    const strJs2 = str2.replace(/[\r\n]/g, '').replace(/console.log\('.+?'\);/g, '')
    fs.writeFile(path.join(__dirname, './12312/4.html'), strHtml + `<script>${strJs2}</script >`,err=>{

      console.log('写入成功')
      
    })
  })
})